<?php

use Illuminate\Database\Schema\Blueprint;
use \Illuminate\Database\Migrations\Migration;

class CreateLoggerTable extends Migration
{
    public function up()
    {
        Schema::create('logger', function (Blueprint $table) {
            $table->increments('id');

            $table->string('pathinfo', 255)->default('')->comment('path info');
            $table->text('request_header')->comment('请求头信息');
            $table->text('request_body')->comment('请求body');
            $table->text('response_header')->comment('响应头信息');
            $table->text('response_body')->comment('响应body');

            $table->string('method', 10)
                ->default('')->comment('请求方法');
            $table->string('tag', 64)
                ->default('')->comment('tag');
            $table->string('doc_url', 255)
                ->default('')->comment('文档路径');
            $table->string('summary', 128)
                ->default('')->comment('文档summary');
            $table->tinyInteger('is_deprecated')
                ->default(0)->comment('是否是已经废弃的 api');

            $table->text('full_url')->comment('完整请求路径(带 query string)');

            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('logger');
    }
}